<!doctype html>
<html>
    <head>
        <title>Sistema Manejador de Contenido</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta http-equiv="refresh" content="5;URL=http://192.168.1.109/sms/votosms/grafico/<?php print $this->proximo; ?>" >
        <script type="text/javascript">
            HOST_PATHS='http://192.168.1.109/sms/';
        </script>
        <link rel="stylesheet" href="http://192.168.1.109/sms/public/css/jquery/jquery-ui.css" />
        <link rel="stylesheet" href="http://192.168.1.109/sms/public/css/tablesorter/style.css" />
        <link rel="stylesheet" href="http://192.168.1.109/sms/public/css/default.css" />	
        <style>
            #ajax-loader2{
                text-align: center;
                vertical-align: central;
            }
            #title{
                text-align: center;
                font-size: 40px;
                font-weight: bold;
                color: #ee3338;
                text-shadow: 2px 2px 2px #2e2e2e;
            }
        </style>
        <script type="text/javascript" src="http://192.168.1.109/sms/public/js/jquery.js"></script>
        <script type="text/javascript" src="http://192.168.1.109/sms/public/js/jquery-ui.js"></script>
        <script type="text/javascript" src="http://192.168.1.109/sms/public/js/tiny_mce/jquery.tinymce.js"></script>
        <script type="text/javascript" src="http://192.168.1.109/sms/public/js/custom.js"></script>
        <script type="text/javascript" src="http://192.168.1.109/sms/public/js/highcharts/highcharts.js"></script>
        <script type="text/javascript" src="http://192.168.1.109/sms/public/js/highcharts/modules/exporting.js"></script>
        <script type="text/javascript" src="http://192.168.1.109/sms/public/js/jquery.tablesorter.min.js"></script>
        <script type="text/javascript" src="http://192.168.1.109/sms/views/votosms/js/default.js"></script>    </head>
    <body>
        <div id="title"><?php print $this->title; ?></div>
        <script>
            $(function () {
                var chart;
                $(document).ready(function() {
        
                    // Radialize the colors
                    Highcharts.getOptions().colors = $.map(Highcharts.getOptions().colors, function(color) {
                        return {
                            radialGradient: { cx: 0.5, cy: 0.3, r: 0.7 },
                            stops: [
                                [0, color],
                                [1, Highcharts.Color(color).brighten(-0.3).get('rgb')] // darken
                            ]
                        };
                    });
        
                    // Build the chart
                    chart = new Highcharts.Chart({
                        chart: {
                            renderTo: 'containergy',
                            plotBackgroundColor: null,
                            plotBorderWidth: null,
                            plotShadow: false
                        },
                        title: {
                            text: 'Elecciones Yaracuy, 2012'
                        },
                        tooltip: {
                            pointFormat: '{series.name}: <b>{point.percentage}%</b>',
                            percentageDecimals: 1
                        },
                        plotOptions: {
                            pie: {
                                allowPointSelect: true,
                                cursor: 'pointer',
                                dataLabels: {
                                    enabled: true,
                                    color: '#000000',
                                    connectorColor: '#000000',
                                    formatter: function() {
                                        return '<b>'+ this.point.name +'</b>: '+ this.percentage +' %';
                                    }
                                }
                            }
                        },
                        series: [{
                                type: 'pie',
                                name: 'VOTOS',
                                data: [
                                    ['NO REPORTADO <?php print $this->oposicion; ?>', <?php
$j = Math::calcPercent($this->oposicion+$this->psuv, $this->psuv);
print 100 - $j;
?>],
                                        {
                                            name: 'REPORTADO <?php print $this->psuv; ?>',
                                            y: <?php print $j; ?>,
                                            sliced: true,
                                            selected: true
                                        }
                                    ]
                                }]
                        });
                    });
    
                });
        </script>
        <div id="containergy" style="min-width: 400px; height: 400px; margin: 0 auto"></div>
    </body>
</html>